package com.wanchuang.hepos.ui.page.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;

import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.wanchuang.hepos.R;
import com.wanchuang.hepos.help.GlideHelper;
import com.wanchuang.hepos.proto.Bank;
import com.wanchuang.hepos.proto.MemberBank;

import java.util.List;

/**
 * 文件名 : ZhanDanAdapter
 * 创建者 : MangoWang
 * 创建日期 : 2019/12/26 15:44
 * 微信 : MangoWaWang
 * 邮箱 : 763482205@qq.com
 * 描述 : TODO
 */
public class KaBaoAdapter extends BaseQuickAdapter<MemberBank.bank, BaseViewHolder> implements LoadMoreModule {
    public KaBaoAdapter(List<MemberBank.bank> data) {
        super(R.layout.item_xin_yong_bank, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MemberBank.bank item) {
        helper.setText(R.id.tv_name, item.getBankName())
                .setText(R.id.tv_number, item.getBankCard())
                .setText(R.id.tv_time, "有效期 " + item.getBankName())
                .setText(R.id.tv_type, item.getBankName());
        GlideHelper.INSTANCE.loadImage(helper.getView(R.id.iv_image), item.getBankImg());
        if (helper.getLayoutPosition()% 2 == 0) {
            helper.setBackgroundResource(R.id.rv_bg, R.mipmap.bg_bank_two);
        } else {
            helper.setBackgroundResource(R.id.rv_bg, R.mipmap.bg_bank_one);
        }

//        if (item.getIsSupport().equals("0") ) {
//            helper.setVisible(R.id.iv_vip, false);
//        } else {
//            helper.setVisible(R.id.iv_vip, true);
//        }
    }
}
